package com.bawei.mall.product.controller;

import com.bawei.common.core.domain.R;
import com.bawei.mall.product.service.ICategoriesService;
import com.bawei.mall.product.domain.Po.Categories;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author：liurui
 * @Package：com.bawei.mall.search.domain.Po
 * @Project：mall_cloud
 * @name：categories
 */
@RestController
@Log4j2
@RequestMapping("/categories")
public class CategoriesController {
    @Autowired
    private ICategoriesService service;

    @GetMapping("/productCateList/{parentId}")
    public R<List<Categories>> productCateList(@PathVariable Integer parentId){
        List<Categories> list=service.productCateList(parentId);
        return R.ok(list);
    }
}
